package com.byted;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;

public class CharsetD {
	public static void main(String[] args) throws IOException {
		String s = "TestaA0中文";
		byte b[] = s.getBytes("iso-8859-1");
		// byte b[]=s.getBytes();
		for (byte c : b) {
			System.out.println(c);
		}
		System.out.println(Charset.defaultCharset());
		File f = new File("C:" + File.separator + "11.txt");
		if (!f.exists()) {
			f.createNewFile();
		}
		
		//
		OutputStream outputStream = new FileOutputStream(f);
		outputStream.write(b);
		outputStream.flush();
		outputStream.close();
		
		

	}

}
